/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.ex;

/**
 * <p>Project: javaseapp - Ex100
 * <p>Powered by webrx On 2021-07-30 17:23:22
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Ex100 {
    public static void main(String[] args) {
        int n = 0;
        //公
        for (int i = 0; i < 20; i++) {
            //母
            for (int j = 0; j < 33; j++) {
                //小鸡
                for (int k = 1; k < 100; k++) {
                    ++n;
                    int a = i + j + k * 3;
                    int b = i * 5 + j * 3 + k;
                    if (a == 100 && b == 100) {
                        System.out.printf("公鸡：%d只，母鸡：%d只，小鸡：%d只。%n", i, j, 3 * k);
                    }
                }
            }
        }
        System.out.println("共循环" + n + "次。");
    }
}
